/**
 * Created by Administrator on 2017/3/12 0012.
 */
import Relay from "react-relay";

export default class LoginMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { findEnterpriseByUserId }`;
    }

    getVariables() {
        return {
            argsInput: {
                uid: this.props.uid,
                token: this.props.token,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on findEnterpriseByUserIdPayload {
            findEnterpriseByUserId {
                errorCode
                value
                totalResult
                id
                token
                userModel{
                    uid
                    name
                    enterpriseDomainList{
                        permissionId
                        enterpriseName
                        enterpriseId
                        entype
                        serviceType
                        address
                        roleId
                        roleNumber
                    }
                 
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on findEnterpriseByUserIdPayload {
                findEnterpriseByUserId {
                    errorCode
                    value
                    totalResult
                    id
                    token
                    userModel{
                        uid
                        name
                        enterpriseDomainList{
                            permissionId
                            enterpriseName
                            enterpriseId
                            entype
                            serviceType
                            address
                            roleId
                            roleNumber
                        }
                     }
                     
                    }
                }
            `]
        }];
    }

}